package com.t168.appinfo.controller.background;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSON;
import com.t168.appinfo.entity.AppCategory;
import com.t168.appinfo.service.reception.appcategory.AppCategoryService;

@Controller
@RequestMapping("/bgAppCategory")
public class BgAppCategoryController {


	@Resource(name = "appCategoryService")
	private AppCategoryService appCategoryService;
	
	public AppCategoryService getAppCategoryService() {
		return appCategoryService;
	}

	public void setAppCategoryService(AppCategoryService appCategoryService) {
		this.appCategoryService = appCategoryService;
	}
	
	
	@RequestMapping(value="/getLevelTwoCgInfo",produces={"application/json;charset=UTF-8"})
	@ResponseBody
	public String getLevelTwoCgInfo(@RequestParam("categoryId")String categoryId){
		System.out.println("==============================="+categoryId);
		List<AppCategory> appCategoryList = appCategoryService.getLevelTwoCgInfo(categoryId);
		return JSON.toJSONString(appCategoryList);
	}
	
	
}
